package com.yenlien.traceyun.control.dao;

import com.yenlien.traceyun.control.entity.Goods;
import com.yenlien.traceyun.webase.dao.BaseJpaDao;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author jialong
 * @date 2021/05/19
 * @description: 货物数据层
 **/
public interface GoodsDao extends BaseJpaDao<Goods> {


    @Query(value = "SELECT * FROM goods WHERE shelves_id IN (?1)", nativeQuery = true)
    List<Goods> getGoodsByShelvesId(List<Long> shelvesIds);

    @Query(value = "SELECT * FROM goods WHERE shelves_id = ?1", nativeQuery = true)
    Goods findBySId(Long shelvesId);

}
